var cpid="",wcqkid="",wcqkbh="";
$(document).ready(function(){  
	//日期函数
	$('.dateInput').datetimepicker({
			format: 'yyyy-mm-dd',
	        forceParse: 0,
	        todayBtn:  1,
	        autoclose: 1,
	        todayHighlight: 1,
	        minView: 2,
	        bootcssVer:3
	});	
	$('.dateInput').datetimepicker('setStartDate', '1900-01-01');
	var endDate = new Date();
	$('.dateInput').datetimepicker('setEndDate', endDate);
	
	$("#functionNav").attr("href",navAddr);
	
	//设置上传影像的格式
	$("#yxImage,#skImage").fileinput({	
		showUpload : false,
        allowedPreviewTypes : [ 'image' ],
        allowedFileExtensions : [ 'jpg','jpeg' ],
	    overwriteInitial: true,
	    maxFileSize: 10240	     
	});
	//设置上传附件的格式
	$("#fjname").fileinput({
		showUpload : false,
	     initialPreviewConfig: [
	         {width: "120px"}
	     ],
	     overwriteInitial: true,
	     maxFileSize: 10240	
    });		
	//设置藏品分类级联下拉框
	//var doms_cpfl = ["DJH_CPFL1","DJH_CPFL2","DJH_CPFL3"];
	//selectThree(url_cplb,doms_cpfl);
	//设置藏品时代级联下拉框
	//var doms_sd = ["DJH_SD1","DJH_SD2","DJH_SD3","DJH_SD4"];
	//selectFour(url_nd,doms_sd);
	//获取并填充文物普查类别
	var wwlbJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInjb.do",{'tableName':'jb_wwlb'});
	loadSelect("#form_cpinfo select[name=cplb]",wwlbJson.rows,'id','name');
	//获取并填充数量单位
	var sldwJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInjb.do",{'tableName':'jb_ctsldw'});
	loadSelect("#form_cpinfo select[name=ctsldw]",sldwJson.rows,'id','name');
	//获取并填充数量单位
	var sjsldwJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInjb.do",{'tableName':'jb_sjsldw'});
	loadSelect("#form_cpinfo select[name=sjsldw]",sjsldwJson.rows,'id','name');
	//获取并填充来源类型
	var lylxJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInJb.do",{'tableName':'jb_lyfs'});
	loadSelect("#form_cpinfo select[name=lylx]",lylxJson.rows,'id','name');
	//获取并填充拍摄方向
	var psfxJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInjb.do",{'tableName':'jb_psfx'});
	loadSelect("#form_yx select[name=psfx]",psfxJson.rows,'id','name');
	//获取并填充摄影师
	var sysJson = ajaxResult("get",false,ProjectName+"/root.getUserListByRole.do",{'roleId':'sheyingshi'});
	if(sysJson.status=="ok"){
		loadSelect("#form_yx select[name=psrid]",sysJson.rows,'userid','username');
	}
	//获取并填充伤况主体
	var skztJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInXtjb.do",{'tableName':'xtjb_zt'});
	loadSelect("#form_wcqk select[name=skzt]",skztJson.rows,'id','name');
	//获取并填充完残情况
	var wcqkJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInXtjb.do",{'tableName':'jb_wccd'});
	loadSelect("#form_wcqk select[name=wcqk]",wcqkJson.rows,'id','name');
	//获取并填充保存状态
	var bcztJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInJb.do",{'tableName':'jb_bczt'});
	loadSelect("#form_wcqk select[name=bczt]",bcztJson.rows,'id','name');
	
   //获取Url中的参数
   cpid =GetQueryString("id"); 
   //获取藏品信息
   var cpInfo = ajaxResult("get",false,ProjectName+"/colmanage.getDbCp.do",{'id':cpid});
   //填充藏品信息到表单
   loadData("#form_cpinfo",cpInfo.data);  
   //获取并填充藏品分类
   getCpflSelect(cpInfo);
   //获取并填充时代
   getSdSelect(cpInfo);
   //获取藏品编号，并设置各个表单中的藏品编号
   $("input[name=cpbh]").val(cpid);
   //获取附属物列表
   createTable('#fswTable',ProjectName+'/colmanage.getFushuwuList.do','id',fswTblTitle,{'cpbh':cpid});
   //获取影像列表
   createTable('#yxTable',ProjectName+'/colmanage.getYingxiangList.do','id',yxTblTitle,{'cpbh':cpid});
   //获取附件列表
   createTable('#fjTable',ProjectName+'/colmanage.getFujianList.do','id',fjTblTitle,{'cpbh':cpid});
   //获取鉴定信息列表
   createTable('#jdyjTable',ProjectName+'/colmanage.getJiandingXinxiList.do','id',jdxxTblTitle,{'cpbh':cpid});
   //获取最新的完残信息
   loadWcqk(cpid);   
   
   //保存登编信息
   $("#dengbian_btn").click(function(){
	   if($("#zdjhRequired").val()=="false"){
		   return false;
	   }
	   if(checkform("#form_cpinfo")){
		   var params_dengbian =$("#form_cpinfo").serializeObject();
		   params_dengbian['opType'] = "update";
		   params_dengbian['id'] = cpid;
		   $(".cpfl").each(function(index,content){
			   if($(this).val()=="" || $(this).val()==null){
				   var cpflname = $(this).attr("name");
				   params_dengbian[cpflname]=null; 
			   }
		   });
		   $(".sd").each(function(index,content){
			   if($(this).val()=="" || $(this).val()==null){
				   var sdname = $(this).attr("name");
				   params_dengbian[sdname]=null; 
			   }
		   });
		   var dbResult = ajaxResult("post",false,ProjectName+"/colmanage.addCangpin.do",params_dengbian);
		   if(dbResult["status"] == 'ok'){
			   alertFunc("登编信息保存成功！");
		   }else{
			   alertFunc(dbResult["error"]);
		   }
	   }
   });
   $("#tijiao_btn").click(function(){
//	   alertFunc("功能正在开发中！");
	   if($("#zdjhRequired").val()=="false"){
		   return false;
	   }
	   if(checkform("#form_cpinfo")){
		   var params_dengbian =$("#form_cpinfo").serializeObject();
		   params_dengbian['opType'] = "update";
		   params_dengbian['id'] = cpid;
		   $(".cpfl").each(function(index,content){
			   if($(this).val()=="" || $(this).val()==null){
				   var cpflname = $(this).attr("name");
				   params_dengbian[cpflname]=null; 
			   }
		   });
		   $(".sd").each(function(index,content){
			   if($(this).val()=="" || $(this).val()==null){
				   var sdname = $(this).attr("name");
				   params_dengbian[sdname]=null; 
			   }
		   });
		   var dbResult = ajaxResult("post",false,ProjectName+"/colmanage.addCangpin.do",params_dengbian);
		   if(dbResult["status"] == 'ok'){
			   bootbox.setLocale("zh_CN");
			   bootbox.confirm("提交后进入分配库房操作，您确定提交吗？",function(r){
				   if(r){
					   var dbResult = ajaxResult("post",false,ProjectName+"/colmanage.tijiaoDbFenpeiKf.do",{'ids':cpid+""});
					   if(dbResult["status"] == 'ok'){
						   alertFunc("提交成功！");
						   $("#return_btn").click();
						   
					   }else{
						   alert(dbResult["error"]);
					   }
				   }
			   });
		   }else{
			   alertFunc(dbResult["error"]);
		   }
	   }
	   
   })
   
   
   //增加/修改附属物信息
   $("#fsw_btn").click(function(){
	   if($("#fswbhRequired").val()=="false"){
		   return false;
	   }
	   if(checkform("#form_fsw")){
		   var zksl=$("#form_fsw input[name=fswsl]").val();
		   $("#form_fsw input[name=zksl]").val(zksl);
		   add_upload_data("#form_fsw","/colmanage.addFushuwu.do","附属物","fsw");
	   }
   });
   
   //增加/修改影像信息
   $("#yx_btn").click(function(){
	   if(checkform("#form_yx")){
		   $(".file-input").next("span").remove();
		   if($("#form_yx select[name=psrid]").val()!=null && $("#form_yx select[name=psrid]").val()!=''){
			   var psrmc =$("#form_yx select[name=psrid]").find("option:selected").text();
			   $("#form_yx input[name=psrmc]").val(psrmc);
		   }else{
			   $("#form_yx input[name=psrmc]").val('');
		   }		   
		 if($("#form_yx input[name=id]").val()==null || $("#form_yx input[name=id]").val()==''){ 	   
		   if($("input[name=yxImage]").val()!=null && $("input[name=yxImage]").val()!=''){
		     var option = {
			     url : ProjectName+"/colmanage.addDbYx.do",
			     async:false,
			     type: "post",
			     dataType: 'json',
			     success : function(data){	
			    	 if(data.status=="ok"){
			    		 alertFunc("增加影像信息成功！");
 			    	 }else{
 			    		 alertFunc(data.error);
 			    	 }
				 }
			  };
			  $("#form_yx").ajaxSubmit(option);
			  $('#yxModal').modal('hide');
			  $("#form_yx")[0].reset();
			  $('#yxTable').bootstrapTable('refresh');
			  return false;
		   }else{			   
			   $("#form_yx .file-input").parent("div").append("<span class='apendhtml' style='color: red;margin-left: 5px;'>请选择文件</span>");
		   }	
		 }else{
			   add_upload_data("#form_yx","/colmanage.addDbYx.do","影像","yx");
		 }  
	  }
   });  
   
   //增加/修改鉴定意见
   $("#jdyj_btn").click(function(){
	   if(checkform("#form_jdyj")){
		   add_upload_data("#form_jdyj","/colmanage.addJiandingXinxi.do","鉴定意见","jdyj");
	   }
   });
   
   //上传附件
   $("#fj_btn").click(function(){
	   if($("#form_fj input[name=fjname]").val()!=null && $("#form_fj input[name=fjname]").val()!=''){
		   $(".file-input").next("span").remove();
		   var option = {
				     url : ProjectName+"/colmanage.addFujian.do",
				     async:false,
				     type: "post",
				     dataType: 'json',
				     success : function(data){
				    	 if(data.status=="ok"){
				    		 alertFunc("上传成功！");
	 			    	 }else{
	 			    		 alertFunc(data.error);
	 			    	 }
					 }
				  };
				  $("#form_fj").ajaxSubmit(option);
				  $('#fjModal').modal('hide');
				  $("#form_fj")[0].reset();
				  $('#fjTable').bootstrapTable('refresh');
				  return false;
	   }else{
		   $("#form_fj .file-input").parent("div").append("<span class='apendhtml' style='color: red;margin-left: 5px;'>请选择文件</span>");
	   }	
   });
   
   //显示修改完残信息表单
   $('#wcqk_op_btn').click(function(){
	   $("#form_wcqk_view").hide(); 
	  $("#form_wcqk").show(); 
	  $("#wcqk_op_btn").hide();
	  $("#wcqk_btn").show();
   });
   
 //增加/修改完残信息
   $("#wcqk_btn").click(function(){	   
   	if(checkform("#form_wcqk")){		  
		     var option = {
			     url : ProjectName+"/colmanage.addDbWc.do",
			     async:false,
			     type: "post",
			     dataType: 'json',
			     success : function(data){	
			    	 if(data.status=="ok"){
			    		 if(data.id != undefined)
				    		 wcqkid = data.id;
			    		 	 wcqkbh = data.wcqkbh;
				    	 alertFunc("保存完残信息成功！");
				    	 $('#form_wcqk input[name=opType]').val('update');
 			    	 }else{
 			    		 alertFunc(data.error);
 			    	 }			    	 
				 }
			  };
			  $("#form_wcqk").ajaxSubmit(option);
			  //获取完残影像列表	
			  loadWcqkFinish(cpid);   
			  return false;   		
  	  }
   });
})

//验证总登记号是否重复
function checkZdjh(zdjhElem){	
	var zdjhVal = $.trim($(zdjhElem).val());
	if(zdjhVal!=null && zdjhVal!=''){
		var zdjhJson = ajaxResult("get",false,ProjectName+"/colmanage.existInDb.do",{'id':cpid,'zdjh':zdjhVal});
		if(zdjhJson.status=="ok"){
			if(zdjhJson.data!=false){
				$("#form_cpinfo input[name=zdjh]").next("span").remove();
				$("#form_cpinfo input[name=zdjh]").after("<span class='apendhtml' style='color: red;margin-left: 5px;'>总登记号重复</span>");
				$("#zdjhRequired").val("false");
			}else{
				$("#form_cpinfo input[name=zdjh]").next("span").remove();
				$("#zdjhRequired").val("true");
			}
		}else{
			alertFunc("总登记号验证失败！");
		}
	}
}

//验证附属物编号是否重复
function checkFswbh(fswbhElem){	
	var fswbhVal = $.trim($(fswbhElem).val());
	var  id= $("#form_fsw input[name=id]").val();
	if(fswbhVal!=null && fswbhVal!=''){
		var fswbhJson = ajaxResult("get",false,ProjectName+"/colmanage.existInDbFsw.do",{'id':id,'cpbh':cpid,'fswbh':fswbhVal});
		if(fswbhJson.status=="ok"){
			if(fswbhJson.data!=false){
				$("#form_fsw input[name=fswbh]").next("span").remove();
				$("#form_fsw input[name=fswbh]").after("<span class='apendhtml' style='color: red;margin-left: 5px;'>附属物编号重复</span>");
				$("#fswbhRequired").val("false");
			}else{
				$("#form_fsw input[name=fswbh]").next("span").remove();
				$("#fswbhRequired").val("true");
			}
		}else{
			alertFunc("附属物编号验证失败！");
		}
	}
}

//点击增加按钮，改变模态框中保存按钮的值
function modal_add(tabname){
	$("#form_"+tabname)[0].reset();
	$("input[name=id]").val('');
	$("input[name=opType]").val('add');
	$("#yxwjdiv").show();
	$('#yxViewDiv').hide();
	$("#"+tabname+"_btn").text("增加");
}

//增加/修改数据
function add_upload_data(formid,url,alertinfo,tblname){
	var params =$(formid).serializeObject();
	   var result="";
	   if(params.id == null || params.id == ""){
		   params['opType'] = "add";
		   result = ajaxResult("post",false,ProjectName+url,params);
		   if(result["status"] == 'ok'){
			   alertFunc("增加"+alertinfo+"信息成功！");
		   }else{
			   alertFunc(result["error"]);
		   }
	   }else{
		   params['opType'] = "update";
		   result = ajaxResult("post",false,ProjectName+url,params);
		   if(result["status"] == 'ok'){
			   alertFunc("修改"+alertinfo+"信息成功！");
		   }else{
			   alertFunc(result["error"]);
		   }
	   }	  	 	
	   $(formid)[0].reset();
	   $("input[name=id]").val('');
	   $('#'+tblname+'Modal').modal('hide');
	   $("#"+tblname+'Table').bootstrapTable('refresh');	
}
       
//填充附属物修改信息
function modiFsw(fswInfo){
	if (fswInfo != null){
		loadData("#form_fsw",fswInfo);
		$('#fswModal').modal('show');
		$("#fsw_btn").text("修改");
	}
}

//填充影像修改信息
function modiYx(yxInfo){
	if (yxInfo != null){
		loadData("#form_yx",yxInfo);
		$('#form_yx input[name=opType]').val('update');
		$("#yxwjdiv").hide();
		$('#yxViewDiv img').attr('src',imageAddr+yxInfo.sldz);
		$('#yxViewDiv').show();
		$('#yxModal').modal('show');
		$("#yx_btn").text("修改");
	}
}

//填充鉴定意见修改信息
function modiJdyj(jdyjInfo){
	if (jdyjInfo != null){
		loadData("#form_jdyj",jdyjInfo);
		$('#jdyjModal').modal('show');
		$("#jdyj_btn").text("修改");
	}
}
//填充完残情况信息
function loadWcqk(cpbh){	
	var wcqkJson = ajaxResult("get",false,ProjectName+"/colmanage.getDbWc.do",{'cpbh':cpbh});
	if(wcqkJson.status=="ok"){
		if(jQuery.isEmptyObject(wcqkJson.data)){
			$("#form_wcqk_view").hide();
			$('#wcqk_op_btn').hide();			
			return false;
		}
		wcqkid=wcqkJson.data.id;
		wcqkbh=wcqkJson.data.wcqkbh;
		loadData("#form_wcqk",wcqkJson.data);
		var skztJson = ajaxResult("get",false,ProjectName+"/sysmanage.getNameInJbByIdTableName.do",{'tableName':'xtjb_zt','id':wcqkJson.data.skzt});
		if(skztJson.status=="ok"){
			if(skztJson.rows.length>0)
				$('#form_wcqk_view input[name=skzt]').val(skztJson.rows[0].name);
		}		
		var wcqkvalJson = ajaxResult("get",false,ProjectName+"/sysmanage.getNameInJbByIdTableName.do",{'tableName':'jb_wccd','id':wcqkJson.data.wcqk});
		if(wcqkvalJson.status=="ok"){
			if(wcqkvalJson.rows.length>0)
				$('#form_wcqk_view input[name=wcqk]').val(wcqkvalJson.rows[0].name);
		}
		var bcztJson = ajaxResult("get",false,ProjectName+"/sysmanage.getNameInJbByIdTableName.do",{'tableName':'jb_bczt','id':wcqkJson.data.bczt});
		if(bcztJson.status=="ok"){
			if(bcztJson.rows.length>0)
				$('#form_wcqk_view input[name=bczt]').val(bcztJson.rows[0].name);
		}
		$('#form_wcqk_view input[name=ssyy]').val(wcqkJson.data.ssyy);
		if(wcqkJson.data.sfxf==1){
			$('#form_wcqk_view input[name=sfxf]').val('是');
		}else if(wcqkJson.data.wcbz==0){
			$('#form_wcqk_view input[name=sfxf]').val('否');
		}	
		$('#form_wcqk_view textarea[name=ssms]').val(wcqkJson.data.ssms);		
		$("#form_wcqk").hide();
		$('#wcqk_btn').hide();
		if(wcqkJson.data.wcbz==1){
			$('#form_wcqk input[name=opType]').val('add');
		}else if(wcqkJson.data.wcbz==0){
			$('#form_wcqk input[name=opType]').val('update');
		}	
		//获取完残影像列表	
		loadWcyxList(wcqkbh);
	}	
}

//填充完残情况信息
function loadWcqkFinish(cpbh){	
	var wcqkJson = ajaxResult("get",false,ProjectName+"/colmanage.getDbWc.do",{'cpbh':cpbh});
	if(wcqkJson.status=="ok"){
		wcqkid=wcqkJson.data.id;
		wcqkbh=wcqkJson.data.wcqkbh;
		loadData("#form_wcqk",wcqkJson.data);		
		if(wcqkJson.data.wcbz==1){
			$('#form_wcqk input[name=opType]').val('add');
		}else if(wcqkJson.data.wcbz==0){
			$('#form_wcqk input[name=opType]').val('update');
		}	
		//获取完残影像列表	
		loadWcyxList(wcqkbh);
	}
}


//删除影像
function delImg(id,yxdz,sldz,lldz){
	bootbox.setLocale("zh_CN");
	bootbox.confirm("确认要删除该影像文件么？",function(r){
		if(r){
			var params = new Object();
			params["id"]=id;
			params["yxdz"]=yxdz;
			params["sldz"]=sldz;
			params["lldz"]=lldz;
			var delyxJson = ajaxResult("get",false,ProjectName+"/colmanage.deleteDbYx.do",params);
			if(delyxJson.status=='ok'){
				alertFunc('删除影像成功！');
				$("#yxTable").bootstrapTable('refresh');
			}else{
				alertFunc(delyxJson.error);
			}	
		}
	});
}

//填充完残影像信息
function loadWcyxList(wcqkbh){
	var imgHtml="";
	var wcyxJson = ajaxResult("get",false,ProjectName+"/colmanage.getDbWcYxList.do",{'wcqkbh':wcqkbh});
	if(wcyxJson.status=='ok'){
		$.each(wcyxJson.rows,function(index,content){
			if(content["wcbz"]==0){
				imgHtml += "<div class='imgdiv'><img src='"+imageAddr+content["sldz"]+"'><a href='javascript:void(0);' onclick='delWcImg("+content["id"]+",\""+content["yxdz"]+"\",\""+content["sldz"]+"\",\""+content["lldz"]+"\",\""+content["wcqk"]+"\")'>删除</a></div>";
			}else{
				imgHtml += "<div class='imgdiv'><img src='"+imageAddr+content["sldz"]+"'></div>";
			}
		})		
		$("#wcyxDiv").html(imgHtml);
	}	
}

//删除完残影像
function delWcImg(id,yxdz,sldz,lldz){
	bootbox.setLocale("zh_CN");
	bootbox.confirm("确认要删除该影像文件么？",function(r){
		if(r){
			var params = new Object();
			params["id"]=id;
			params["yxdz"]=yxdz;
			params["sldz"]=sldz;
			params["lldz"]=lldz;
			var delyxJson = ajaxResult("get",false,ProjectName+"/colmanage.deleteDbYx.do",params);
			if(delyxJson.status=='ok'){
				loadWcyxList(wcqkbh);
			}else{
				alertFunc(delyxJson.error);
			}
		}
	});
}

//删除附件
function delFj(id,wjdz){
	bootbox.setLocale("zh_CN");
	bootbox.confirm("确认要删除该文件么？",function(r){
		if(r){
			var params = new Object();
			params["id"]=id;
			params["wjdz"]=wjdz;
			var delfjJson = ajaxResult("get",false,ProjectName+"/colmanage.deleteFujian.do",params);
			if(delfjJson.status=='ok'){
				alertFunc('删除文件成功！');
				$("#fjTable").bootstrapTable('refresh');
			}else{
				alertFunc(delfjJson.error);
			}	
		}
	});
}

//----------------------------------------------------
var fswTblTitle = [{
	        field: 'fswbh',
	        title: '附属物编号'
	    }, {
	        field: 'fswmc',
	        title: '附属物名称'
	    }, {
	        field: 'fswsl',
	        title: '附属物数量'
	    }, {
	        field: 'lrrmc',
	        title: '操作人'
	    }, {
	        field: '',
	        title: '操作',
	        formatter: function(value, row, index) {    
	        	var result ="";
        		if(row.wcbz==0)	
		      	    result = "<a onclick='modiFsw("+JSON.stringify(row)+")' href='javascript:void(0)'>修改</a>&nbsp;&nbsp;&nbsp;<a onclick='delRecord(\"#fswTable\",\"/colmanage.deleteFushuwu.do\",{\"id\":"+row.id+"})' href='javascript:void(0)'>删除</a>";
	        	return result;
	    	}
	    }]

var yxTblTitle = [{
    field: 'sldz',
    title: '缩略影像',
    formatter: function(value, row, index) {     	
    	if(value!="" && value!=null)	
      	    return "<img src='"+imageAddr+value+"'>";    	
    	else
    		return "";
    }
}, {
    field: 'psfxms',
    title: '拍摄方向'
}, {
    field: 'psrmc',
    title: '拍摄人'
},{
    field: 'pssj',
    title: '拍摄时间'
},{
    field: 'sfyx',
    title: '代表影像',
    formatter: function(value, row, index) {     	
    	if(value==1)	
      	    return "是";
    	else
    		return "";
      	}
},{
    field: '',
    title: '操作',
    formatter: function(value, row, index) {     
    	var result ="";
    	if(row.wcbz==0)		
	   	    result = "<a onclick='modiYx("+JSON.stringify(row)+")' href='javascript:void(0)'>修改</a>&nbsp;&nbsp;&nbsp;<a onclick='delImg("+row.id+",\""+row.yxdz+"\",\""+row.sldz+"\",\""+row.lldz+"\")' href='javascript:void(0)'>删除</a>";
    	return result;  
    } 	
}]

var fjTblTitle = [{
	        field: 'wjmc',
	        title: '文件名'
	    }, {
	        field: 'lrsj',
	        title: '上传日期'
	    }, {
	        field: 'lrrmc',
	        title: '操作人'
	    }, {
	        field: '',
	        title: '操作',
	        formatter: function(value, row, index) {
	        	var result ="";
	        	if(row.wcbz==0)	
		      	    result = "<a onclick='window.open(\""+downloadAddr+row.wjdz+"\")' href='javascript:void(0)'>下载</a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick='delFj("+row.id+",\""+row.fjdz+"\")' href='javascript:void(0)'>删除</a>";
	        	return result;
		     }
	    }]

var jdxxTblTitle = [{
	        field: 'jdyy',
	        title: '鉴定原因'
	    }, {
	        field: 'jdr',
	        title: '鉴定人'
	    }, {
	        field: 'jddw',
	        title: '鉴定单位'
	    }, {
	        field: 'jdsj',
	        title: '鉴定时间'
	    }, {
	        field: 'lrrmc',
	        title: '操作人'
	    }, {
	        field: '',
	        title: '操作',
	        formatter: function(value, row, index) {
	        	var result ="";
	        	if(row.wcbz==0)		
    	      	    result = "<a onclick='modiJdyj("+JSON.stringify(row)+")' href='javascript:void(0)'>修改</a>&nbsp;&nbsp;&nbsp;<a onclick='delRecord(\"#jdyjTable\",\"/colmanage.deleteJiandingXinxi.do\",{\"id\":"+row.id+"})' href='javascript:void(0)'>删除</a>";
	        	return result; 
		     }
	    }]
//----------------------------------------------------
